// src\stores\user.ts
import { defineStore } from 'pinia';

export const useUserStore = defineStore('user', {
  state: () => ({

    user: null as {
      id: number;
      username: string;
      password: string;
      realName: string;
      email: string;
      role: string;
      agriculturalField: string;
      agriculturalMachines: string[];
    } | null,
  }),

  actions: {
    setUser(userData: any) {
      this.user = userData;
    },
  },
});